﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="StudyAreasList.aspx.cs" Inherits="OUSMS.StudyAreasList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <div class="topchannel">
        研究领域列表
    </div>
    <table class="table1" border="0" cellspacing="1" cellpadding="2">
        <tr class="row1">
            <td style="width: 20%"><b>研究领域名称</b></td>
            <td style="width: 50%">
                <asp:TextBox ID="studyAreaNameTxtBox" runat="server" Width="95%" Height="25px"></asp:TextBox></td>
            <td style="width: 30%"><asp:Button ID="addStudyAreaBtn" runat="server" OnClick="addStudyAreaBtn_Click"
                Text="添加部门" Width="120px" Height="25px" BackColor="DarkGray" /></td>
        </tr>
        <tr class="row2">
            <td colspan="3"><asp:Label ID="msgLbl" runat="server" ForeColor="Red"></asp:Label></td>
        </tr>
        <tr>
            <td colspan="3">
                <asp:GridView ID="StudyAreasGridView" runat="server" AutoGenerateColumns="False"
                    ItemType="OUSMS.AppLogic.DataAccessLayer.StudyAreas" AllowPaging="True" PageSize="10"
                    ShowHeaderWhenEmpty="True" EmptyDataText="尚未添加任何研究领域" Width="100%"
                    SelectMethod="StudyAreasGridView_GetData" OnRowDataBound="StudyAreasGridView_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="序号">
                            <ItemTemplate>
                                <asp:Label ID="indexLbl" runat="server" Font-Bold="true"></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle"
                                Wrap="false" Width="30px" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" Font-Bold="true" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="名称">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Item.Name %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle"
                                Wrap="false" />
                            <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="删除">
                            <ItemTemplate>
                                <asp:LinkButton ID="deleteLnkBtn" runat="server" Font-Bold="true" Font-Underline="true" Text="删除" 
                                    OnClientClick="javascript:return confirm('您确定要删除吗？')" OnClick="deleteLnkBtn_Click"
                                    CommandArgument='<%# Item.ID %>'></asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle"
                                Wrap="false" Width="120px" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle CssClass="row2" />
                    <PagerStyle CssClass="rowend" HorizontalAlign="Center" />
                    <RowStyle CssClass="row1" />
                    <AlternatingRowStyle CssClass="row2" />
                    <EmptyDataRowStyle CssClass="row1" />
                </asp:GridView>
            </td>
        </tr>
    </table>
</asp:Content>
